<!DOCTYPE html>
<html>
<head>
    <title>自然资源和规划局测试表</title>
		<#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/fileinput.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrapValidator.min.css">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("cs:zrzyhghj:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("cs:zrzyhghj:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("cs:zrzyhghj:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">

														                    <div class="form-group">
                        <div class="col-sm-2 control-label">一级指标</div>
                        <div class="col-sm-10">
                            <!--<input type="text" class="form-control" @click="zbTree" v-model="zrzyhghj.oneZb" placeholder="一级指标"/>-->
                            <!--一级指标-->
                            <select name=""  class="form-control" v-model="zrzyhghj.oneZb" placeholder="一级指标" @change="updatesec">
                                <!--<option value="0">一级指标1</option>-->
                                <!--onezblist 格式为 [{onezb:"一级指标1"}，{onezb:"一级指标2"}，{onezb:"一级指标3"}]-->
                                <option v-for="item in zbAll" :value="item.onezb">{{item.onezb}}</option>
                            </select>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">二级指标</div>
                        <div class="col-sm-10">
                            <!--<input type="text" class="form-control" v-model="zrzyhghj.secZb" placeholder="二级指标"/>-->
                            <!--二级指标-->
                            <select name="" id="s2" class="form-control" v-model="zrzyhghj.secZb" placeholder="二级指标">
                                <option value="0">二级指标</option>
                                <option v-for="item in seczblist" :value="item.seczb">{{item.seczb}}</option>
                            </select>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">指标名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="zrzyhghj.zbName" placeholder="指标名称"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">解释</div>
                        <div class="col-sm-10">
                            <input name="js" type="text" class="form-control" v-model="zrzyhghj.js" placeholder="解释"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">指标层级</div>
                        <div class="col-sm-10">
                            <input  type="text" class="form-control" v-model="zrzyhghj.zbLevel" placeholder="指标层级"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">部门id</div>
                        <div class="col-sm-10">
                            <input name="deptid" type="text" class="form-control" v-model="zrzyhghj.deptId" placeholder="部门id"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">用户id</div>
                        <div class="col-sm-10">
                            <input  type="text" class="form-control" v-model="zrzyhghj.userId" placeholder="用户id"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">国家标准</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="zrzyhghj.nationalStandards" placeholder="国家标准"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">计算依据</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="zrzyhghj.calcuBasis" placeholder="计算依据"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">创建时间</div>
                        <div class="col-sm-10">
                            <input name="createtime" type="text" class="form-control" v-model="zrzyhghj.createTime" placeholder="创建时间"/>
                        </div>
                    </div>
											                    <div class="form-group">
                        <div class="col-sm-2 control-label">原始数据文件</div>
                        <div class="col-sm-10">
                            <input type="file" name="file" id="form_file" class="form-control" placeholder="原始数据文件"/>
                            <!--<input type="text" id="form_file_text" class="form-control" style="display :none" v-model="zrzyhghj.oriDataFile" placeholder="原始数据文件"/>-->
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">已上传文件</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="uploadfilename" v-model="zrzyhghj.oriDataFile" placeholder=""/>
                        </div>
                    </div>
							            <div class="form-group">
                <div class="col-sm-4 control-label"></div>
                <input type="button" class="btn btn-primary" id="btnSaveOrUpdate" data-loading-text="保存中..." @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-primary" id="validateBtn" value="手动验证"></input>
                &nbsp;&nbsp;<input type="button" class="btn btn-primary" id="resetBtn" value="重置"></input>
            </div>
        </form>
    </div>
</div>

<!-- 选择指标 -->
<div id="zbLayer" style="display: none;padding:10px;">
    <ul id="zbTree" class="ztree"></ul>
</div>

<script src="${request.contextPath}/statics/libs/bootstrapValidator.min.js"></script>
<script src="${request.contextPath}/statics/libs/zh_CN.js"></script>
<script src="${request.contextPath}/statics/libs/fileinput.min.js"></script>
<script src="${request.contextPath}/statics/libs/zh.js"></script>
<script src="${request.contextPath}/statics/js/modules/cs/zrzyhghj.js?_${.now?long}"></script>
</body>
<script>
   //  $(function () {
   //      $('form').bootstrapValidator({
   //          message: 'This value is not valid',
   //          feedbackIcons: {
   //              valid: 'glyphicon glyphicon-ok',
   //              invalid: 'glyphicon glyphicon-remove',
   //              validating: 'glyphicon glyphicon-refresh'
   //          },
   //          fields: {
   //              js: {
   //                  message: '指标解释填写失败',
   //                  validators: {
   //                      notEmpty: {
   //                          message: '指标解释信息不能为空'
   //                      },
   //                      stringLength: {
   //                          min: 6,
   //                          max: 18,
   //                          message: '指标解释长度必须在6到18位之间'
   //                      }
   //                  }
   //              },
   //              deptid: {
   //                  message: '部门id填写失败',
   //                  validators: {
   //                      notEmpty: {
   //                          message: '部门id不能为空'
   //                      },
   //                      stringLength: {
   //                          min: 1,
   //                          max: 4,
   //                          message: '部门id长度必须在1到4位之间'
   //                      },
   //                      numeric:{
   //                          message: '部门id为数值类型'
   //                      },
   //                      regexp: {
   //                          regexp: /^[a-zA-Z0-9_]+$/,
   //                          message: '用户名只能包含大写、小写、数字和下划线'
   //                      }
   //                  }
   //              }
   //              }
   //
   //      });
   //  });
   //
   //  // Validate the form manually
   // $('#validateBtn').click(function() {
   //      $('form').bootstrapValidator('validate');
   //      });
   //
   // $('#resetBtn').click(function() {
   //       $('form').data('bootstrapValidator').resetForm(true);
   //      });

    // 异步加载1级指标
    // function csonezbAjax() {
    //     $.ajax({
    //         // 编写json格式，设置属性和值
    //         url: baseURL + "cs/zb/list",
    //         contentType: "application/json;charset=UTF-8",
    //         data: '',
    //         dataType: "json",
    //         type: "get",
    //         success: function (data) {
    //             var re = data.page;
    //             $.each(re, function (key, value) { //每一行
    //                 var tr = "<option value=" + key + ">" + key + "</option>";
    //                 $("#secs").append(tr);
    //                 // mcslist.push(key);
    //             });
    //         }
    //     });
    // }

    // csonezbAjax();
</script>
</html>